14-day cumulative number of COVID-19 cases per 100 000

At the end of the page, we provide a detailed description of how the numbers are calculated.

Compute data

In [1]:
# geospatial plotting deps
import branca.colormap as cm
import folium
import geopandas as gpd

import numpy as np
import pandas as pd
pd.set_option("max_rows", None)
from oscovida import fetch_cases, get_population, get_country_data, fetch_cases_last_execution

# get a list of all country names
countries = fetch_cases().index.drop_duplicates()

data = []

for region in countries:
    c, _, _ = get_country_data(region)   # get cumulative infections c
    c = c[-15:]
    try:
        population = get_population(region)
        new_cases = int(c[-1] - c[-15]) 
        incidence = new_cases / population * 100000. 
        data += [(region, population, new_cases, round(incidence, 1))]
    except:
        print(f"Skip {region}")    # skip regions for which we have no population numbers

data.sort(key=lambda x: x[3], reverse=True)

# turn into pandas DataFrame for easier display
table = pd.DataFrame(data, columns=["country", "population", "new cases", "14-day-incidence"]).set_index("country")

# Show last update date
import time
print(f"Last updated {time.asctime()}")
Skip Diamond Princess
Skip MS Zaandam
Last updated Sat Aug 15 09:45:09 2020

Table for all countries

In [2]:
table.sort_index()
Out[2]:
population new cases 14-day-incidence
country
Afghanistan 38928341 756 1.9
Albania 2877800 1841 64.0
Algeria 43851043 7270 16.6
Andorra 77265 64 82.8
Angola 32866268 704 2.1
Antigua and Barbuda 97928 2 2.0
Argentina 45195777 91135 201.6
Armenia 2963234 2749 92.8
Australia 25459700 5755 22.6
Austria 9006400 1746 19.4
Azerbaijan 10139175 2140 21.1
Bahamas 393248 545 138.6
Bahrain 1701583 5070 298.0
Bangladesh 164689383 34220 20.8
Barbados 287371 38 13.2
Belarus 9449321 1500 15.9
Belgium 11589616 8362 72.2
Belize 397621 308 77.5
Benin 12123198 209 1.7
Bhutan 771612 32 4.1
Bolivia 11673029 21161 181.3
Bosnia and Herzegovina 3280815 3659 111.5
Botswana 2351625 410 17.4
Brazil 212559409 563958 265.3
Brunei 437483 1 0.2
Bulgaria 6948445 2553 36.7
Burkina Faso 20903278 132 0.6
Burma 54409794 21 0.0
Burundi 11890781 25 0.2
Cabo Verde 555988 685 123.2
Cambodia 16718971 34 0.2
Cameroon 26545864 1214 4.6
Canada 37855702 5324 14.1
Central African Republic 4829764 44 0.9
Chad 16425859 15 0.1
Chile 19116209 26444 138.3
China 1404676330 1559 0.1
Colombia 50882884 149603 294.0
Comoros 869595 25 2.9
Congo (Brazzaville) 5518092 545 9.9
Congo (Kinshasa) 89561404 535 0.6
Costa Rica 5094114 9111 178.9
Cote d'Ivoire 26378275 888 3.4
Croatia 4105268 1119 27.3
Cuba 11326616 621 5.5
Cyprus 1207361 204 16.9
Czechia 10708982 3119 29.1
Denmark 5792203 1730 29.9
Djibouti 988002 283 28.6
Dominica 71991 0 0.0
Dominican Republic 10847904 14839 136.8
Ecuador 17643060 14054 79.7
Egypt 102334403 2142 2.1
El Salvador 6486201 5682 87.6
Equatorial Guinea 1402985 0 0.0
Eritrea 3546427 6 0.2
Estonia 1326539 113 8.5
Eswatini 1160164 1022 88.1
Ethiopia 114963583 9712 8.4
Fiji 896444 1 0.1
Finland 5540718 268 4.8
France 65273512 24458 37.5
Gabon 2225728 873 39.2
Gambia 2416664 1125 46.6
Georgia 3989175 138 3.5
Germany 83128805 13392 16.1
Ghana 31072945 6346 20.4
Greece 10423056 2155 20.7
Grenada 112519 0 0.0
Guatemala 17915567 11639 65.0
Guinea 13132792 952 7.2
Guinea-Bissau 1967998 107 5.4
Guyana 786559 236 30.0
Haiti 11402533 386 3.4
Holy See 809 0 0.0
Honduras 9904608 7453 75.2
Hungary 9660350 348 3.6
Iceland 341250 98 28.7
India 1380004385 829934 60.1
Indonesia 273523621 26747 9.8
Iran 83992953 34621 41.2
Iraq 40222503 43681 108.6
Ireland 4937796 930 18.8
Israel 8655541 20110 232.3
Italy 60461828 5272 8.7
Jamaica 2961161 204 6.9
Japan 126476458 17584 13.9
Jordan 10203140 136 1.3
Kazakhstan 18776707 11920 63.5
Kenya 53771300 8698 16.2
Korea, South 51269183 703 1.4
Kosovo 1810366 3026 167.1
Kuwait 4270563 8228 192.7
Kyrgyzstan 6524191 5568 85.3
Laos 7275556 2 0.0
Latvia 1886202 77 4.1
Lebanon 6825442 3490 51.1
Lesotho 2142252 280 13.1
Liberia 5057677 66 1.3
Libya 6871287 3706 53.9
Liechtenstein 38137 3 7.9
Lithuania 2722291 277 10.2
Luxembourg 625976 710 113.4
Madagascar 27691019 2775 10.0
Malawi 19129955 910 4.8
Malaysia 32365998 173 0.5
Maldives 540542 1779 329.1
Mali 20250834 62 0.3
Malta 441539 452 102.4
Mauritania 4649660 366 7.9
Mauritius 1271767 1 0.1
Mexico 127792286 86732 67.9
Moldova 4033963 4750 117.8
Monaco 39244 26 66.3
Mongolia 3278292 7 0.2
Montenegro 628062 857 136.5
Morocco 36910558 14919 40.4
Mozambique 31255435 844 2.7
Namibia 2540916 1597 62.9
Nepal 29136808 5780 19.8
Netherlands 17134873 8537 49.8
New Zealand 4822233 47 1.0
Nicaragua 6624554 443 6.7
Niger 24206636 27 0.1
Nigeria 206139587 5294 2.6
North Macedonia 2083380 1761 84.5
Norway 5421242 668 12.3
Oman 5106622 3584 70.2
Pakistan 220892331 8995 4.1
Panama 4314768 14146 327.9
Papua New Guinea 8947027 199 2.2
Paraguay 7132530 3684 51.7
Peru 32971846 108804 330.0
Philippines 109581085 60306 55.0
Poland 37846605 9631 25.4
Portugal 10196707 2711 26.6
Qatar 2881060 3837 133.2
Romania 19237682 17160 89.2
Russia 145934460 72317 49.6
Rwanda 12952209 271 2.1
Saint Kitts and Nevis 53192 0 0.0
Saint Lucia 183629 0 0.0
Saint Vincent and the Grenadines 110947 3 2.7
San Marino 33938 0 0.0
Sao Tome and Principe 219161 14 6.4
Saudi Arabia 34813867 19997 57.4
Senegal 16743930 1640 9.8
Serbia 8737370 3681 42.1
Seychelles 98340 13 13.2
Sierra Leone 7976985 124 1.6
Singapore 5850343 3375 57.7
Slovakia 5459643 509 9.3
Slovenia 2078932 213 10.2
Somalia 15893219 38 0.2
South Africa 59308690 85957 144.9
South Sudan 11193729 160 1.4
Spain 46754783 54291 116.1
Sri Lanka 21413250 71 0.3
Sudan 43849269 518 1.2
Suriname 586634 1188 202.5
Sweden 10099270 3872 38.3
Switzerland 8654618 2439 28.2
Syria 17500657 758 4.3
Taiwan* 23816775 14 0.1
Tajikistan 9537642 580 6.1
Tanzania 59734213 0 0.0
Thailand 69799978 66 0.1
Timor-Leste 1318442 1 0.1
Togo 8278737 183 2.2
Trinidad and Tobago 1399491 257 18.4
Tunisia 11818618 368 3.1
Turkey 84339067 15988 19.0
US 329466283 750948 227.9
Uganda 45741000 231 0.5
Ukraine 43733759 18513 42.3
United Arab Emirates 9890400 3313 33.5
United Kingdom 67886004 10828 16.0
Uruguay 3473727 157 4.5
Uzbekistan 33469199 9812 29.3
Venezuela 28435943 12807 45.0
Vietnam 97338583 372 0.4
West Bank and Gaza 5101416 3997 78.4
Western Sahara 597330 0 0.0
Yemen 29825968 130 0.4
Zambia 18383956 3058 16.6
Zimbabwe 14862927 1903 12.8

Table sorted by 14-day-incidence

In [3]:
table
Out[3]:
population new cases 14-day-incidence
country
Peru 32971846 108804 330.0
Maldives 540542 1779 329.1
Panama 4314768 14146 327.9
Bahrain 1701583 5070 298.0
Colombia 50882884 149603 294.0
Brazil 212559409 563958 265.3
Israel 8655541 20110 232.3
US 329466283 750948 227.9
Suriname 586634 1188 202.5
Argentina 45195777 91135 201.6
Kuwait 4270563 8228 192.7
Bolivia 11673029 21161 181.3
Costa Rica 5094114 9111 178.9
Kosovo 1810366 3026 167.1
South Africa 59308690 85957 144.9
Bahamas 393248 545 138.6
Chile 19116209 26444 138.3
Dominican Republic 10847904 14839 136.8
Montenegro 628062 857 136.5
Qatar 2881060 3837 133.2
Cabo Verde 555988 685 123.2
Moldova 4033963 4750 117.8
Spain 46754783 54291 116.1
Luxembourg 625976 710 113.4
Bosnia and Herzegovina 3280815 3659 111.5
Iraq 40222503 43681 108.6
Malta 441539 452 102.4
Armenia 2963234 2749 92.8
Romania 19237682 17160 89.2
Eswatini 1160164 1022 88.1
El Salvador 6486201 5682 87.6
Kyrgyzstan 6524191 5568 85.3
North Macedonia 2083380 1761 84.5
Andorra 77265 64 82.8
Ecuador 17643060 14054 79.7
West Bank and Gaza 5101416 3997 78.4
Belize 397621 308 77.5
Honduras 9904608 7453 75.2
Belgium 11589616 8362 72.2
Oman 5106622 3584 70.2
Mexico 127792286 86732 67.9
Monaco 39244 26 66.3
Guatemala 17915567 11639 65.0
Albania 2877800 1841 64.0
Kazakhstan 18776707 11920 63.5
Namibia 2540916 1597 62.9
India 1380004385 829934 60.1
Singapore 5850343 3375 57.7
Saudi Arabia 34813867 19997 57.4
Philippines 109581085 60306 55.0
Libya 6871287 3706 53.9
Paraguay 7132530 3684 51.7
Lebanon 6825442 3490 51.1
Netherlands 17134873 8537 49.8
Russia 145934460 72317 49.6
Gambia 2416664 1125 46.6
Venezuela 28435943 12807 45.0
Ukraine 43733759 18513 42.3
Serbia 8737370 3681 42.1
Iran 83992953 34621 41.2
Morocco 36910558 14919 40.4
Gabon 2225728 873 39.2
Sweden 10099270 3872 38.3
France 65273512 24458 37.5
Bulgaria 6948445 2553 36.7
United Arab Emirates 9890400 3313 33.5
Guyana 786559 236 30.0
Denmark 5792203 1730 29.9
Uzbekistan 33469199 9812 29.3
Czechia 10708982 3119 29.1
Iceland 341250 98 28.7
Djibouti 988002 283 28.6
Switzerland 8654618 2439 28.2
Croatia 4105268 1119 27.3
Portugal 10196707 2711 26.6
Poland 37846605 9631 25.4
Australia 25459700 5755 22.6
Azerbaijan 10139175 2140 21.1
Bangladesh 164689383 34220 20.8
Greece 10423056 2155 20.7
Ghana 31072945 6346 20.4
Nepal 29136808 5780 19.8
Austria 9006400 1746 19.4
Turkey 84339067 15988 19.0
Ireland 4937796 930 18.8
Trinidad and Tobago 1399491 257 18.4
Botswana 2351625 410 17.4
Cyprus 1207361 204 16.9
Algeria 43851043 7270 16.6
Zambia 18383956 3058 16.6
Kenya 53771300 8698 16.2
Germany 83128805 13392 16.1
United Kingdom 67886004 10828 16.0
Belarus 9449321 1500 15.9
Canada 37855702 5324 14.1
Japan 126476458 17584 13.9
Barbados 287371 38 13.2
Seychelles 98340 13 13.2
Lesotho 2142252 280 13.1
Zimbabwe 14862927 1903 12.8
Norway 5421242 668 12.3
Lithuania 2722291 277 10.2
Slovenia 2078932 213 10.2
Madagascar 27691019 2775 10.0
Congo (Brazzaville) 5518092 545 9.9
Indonesia 273523621 26747 9.8
Senegal 16743930 1640 9.8
Slovakia 5459643 509 9.3
Italy 60461828 5272 8.7
Estonia 1326539 113 8.5
Ethiopia 114963583 9712 8.4
Liechtenstein 38137 3 7.9
Mauritania 4649660 366 7.9
Guinea 13132792 952 7.2
Jamaica 2961161 204 6.9
Nicaragua 6624554 443 6.7
Sao Tome and Principe 219161 14 6.4
Tajikistan 9537642 580 6.1
Cuba 11326616 621 5.5
Guinea-Bissau 1967998 107 5.4
Finland 5540718 268 4.8
Malawi 19129955 910 4.8
Cameroon 26545864 1214 4.6
Uruguay 3473727 157 4.5
Syria 17500657 758 4.3
Bhutan 771612 32 4.1
Latvia 1886202 77 4.1
Pakistan 220892331 8995 4.1
Hungary 9660350 348 3.6
Georgia 3989175 138 3.5
Cote d'Ivoire 26378275 888 3.4
Haiti 11402533 386 3.4
Tunisia 11818618 368 3.1
Comoros 869595 25 2.9
Mozambique 31255435 844 2.7
Saint Vincent and the Grenadines 110947 3 2.7
Nigeria 206139587 5294 2.6
Papua New Guinea 8947027 199 2.2
Togo 8278737 183 2.2
Angola 32866268 704 2.1
Egypt 102334403 2142 2.1
Rwanda 12952209 271 2.1
Antigua and Barbuda 97928 2 2.0
Afghanistan 38928341 756 1.9
Benin 12123198 209 1.7
Sierra Leone 7976985 124 1.6
Korea, South 51269183 703 1.4
South Sudan 11193729 160 1.4
Jordan 10203140 136 1.3
Liberia 5057677 66 1.3
Sudan 43849269 518 1.2
New Zealand 4822233 47 1.0
Central African Republic 4829764 44 0.9
Burkina Faso 20903278 132 0.6
Congo (Kinshasa) 89561404 535 0.6
Malaysia 32365998 173 0.5
Uganda 45741000 231 0.5
Vietnam 97338583 372 0.4
Yemen 29825968 130 0.4
Mali 20250834 62 0.3
Sri Lanka 21413250 71 0.3
Brunei 437483 1 0.2
Burundi 11890781 25 0.2
Cambodia 16718971 34 0.2
Eritrea 3546427 6 0.2
Mongolia 3278292 7 0.2
Somalia 15893219 38 0.2
Chad 16425859 15 0.1
China 1404676330 1559 0.1
Fiji 896444 1 0.1
Mauritius 1271767 1 0.1
Niger 24206636 27 0.1
Taiwan* 23816775 14 0.1
Thailand 69799978 66 0.1
Timor-Leste 1318442 1 0.1
Burma 54409794 21 0.0
Dominica 71991 0 0.0
Equatorial Guinea 1402985 0 0.0
Grenada 112519 0 0.0
Holy See 809 0 0.0
Laos 7275556 2 0.0
Saint Kitts and Nevis 53192 0 0.0
Saint Lucia 183629 0 0.0
San Marino 33938 0 0.0
Tanzania 59734213 0 0.0
Western Sahara 597330 0 0.0

Geospatial Plot

In [4]:
countries = gpd.read_file("./.country_shapes/countries.shp")
countries = countries.rename(columns={'CNTRY_NAME': 'country'})
In [5]:
countries_geospatial = countries.merge(table, on='country')
In [6]:
countries_geospatial.plot(column='14-day-incidence')
Out[6]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f2bb4e1ff10>

Tutorial: Detailed calculation for one country

In [7]:
cases, deaths, label = get_country_data("Germany")

Cumulative cases yesterday (numbers for today are not known yet):

In [8]:
c_y = cases[-1]
c_y
Out[8]:
223791

Cumulative cases 15 days ago (i.e. 14 days before yesterday)

In [9]:
c_15 = cases[-15]
c_15
Out[9]:
210399

New cases from the last 14 days

In [10]:
c_new = c_y - c_15 
c_new
Out[10]:
13392

Get the population data

In [11]:
population = get_population("Germany")
population
Out[11]:
83128805

Compute the 14-day incidence per 100000, i.e. the cumulative number of new infections in the last 14 days, normalised by the countries population in units of 100000:

In [12]:
incidence = c_new / (population/100000)
incidence
Out[12]:
16.10993926834387

This should compare to Compute numbers as they are provided, for example at https://www.ecdc.europa.eu/en/cases-2019-ncov-eueea (assuming the infection numbers from ECDE and JHU are identical).

In [13]:
# For debugging: When was the data downloaded
fetch_cases_last_execution()
Out[13]:
'15/08/2020 09:13:06'